﻿@page "{id:Guid?}"
@model KentNoteBook.WebApp.Pages.UserAccounts.Dialog.UserEditModel
@{
	ViewData["Title"] = "UserEdit";

	Layout = null;
}

<form id="form_user" class="pl-3" method="post" ajax-form="true">
	@Html.HiddenFor(x => x.Id)

	<div class="form-group row">
		<label class="col-sm-2 col-form-label-sm">User Name </label>
		<div class="col-sm-8">
			@Html.TextBoxFor(x => x.Data.Name, new { @class = "form-control form-control-sm" })
		</div>
	</div>
	<div class="form-group row">
		<label class="col-sm-2 col-form-label-sm" for="NickName">Nick Name</label>
		<div class="col-sm-8">
			@Html.TextBoxFor(x => x.Data.NickName, new { @class = "form-control form-control-sm" })
		</div>
	</div>
	<div class="form-group row">
		<label class="col-sm-2 col-form-label">Email</label>
		<div class="col-sm-8">
			@Html.TextBoxFor(x => x.Data.Email, new { @class = "form-control form-control-sm" })
		</div>
	</div>
	<div class="form-group row">
		<label class="col-sm-2 col-form-label">Mobile</label>
		<div class="col-sm-8">
			@Html.TextBoxFor(x => x.Data.Mobile, new { @class = "form-control form-control-sm" })
		</div>
	</div>
	<div class="form-group row">
		<label class="col-sm-2 col-form-label">IsActive</label>
		<div class="col-sm-8 align-middle">
			<div class="custom-control custom-checkbox my-1">
				@Html.CheckBoxFor(x => x.Data.IsActive, new { @class = "custom-control-input" })
				<label class="custom-control-label" for="Data_IsActive">Active</label>
			</div>
		</div>
	</div>

	<div class="form-group row">
		<label class="col-sm-2 col-form-label">&nbsp;</label>
		<div class="col-sm-8">
			<button type="submit" class="btn btn-primary" ajax-button="true" data-alert-panel="#form_user_alert_panel" data-update-panel="#tbUsers"  asp-page-handler="Save">Save changes</button>
			<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
		</div>
	</div>
	@Html.ValidationSummary(false, null, new { @class = "alert alert-danger" })
	<div id="form_user_alert_panel"></div>
</form>
